﻿using Microsoft.AspNetCore.Builder;
using Serilog;

namespace netCoreStudy.Middle
{
	/// <summary>
	/// swagger 自定义 中间件
	/// </summary>
	public static class SwaggerMiddle
	{
		public static void UseSwaggerMiddle(this IApplicationBuilder app)
		{
			app.UseSwagger(); // 把api 以 json 形式构建出去
			// 把api 以 html 形式构建出去
			app.UseSwaggerUI(c =>
			{
				c.SwaggerEndpoint("/swagger/v1/swagger.json", "采集系统Api接口文档");
				c.RoutePrefix = "swagger";
			});
		}
	}
}